<!DOCTYPE html>
<html>
<head>

</head>
<body>
    <div id="div"></div>
    <button id="btn">单击</button>
    <script>
        var btn = document.getElementById("btn");
        var div = document.getElementById("div");
        btn.onclick = function(){   /*单击按钮弹出对话框*/
            alert(div.tagName);
        }
    </script>
</body>
</html>